﻿/** \file
* \$Rev: 187 $
* 
* \$Date: 2010-04-27 21:58:51 +0000 (Tue, 27 Apr 2010) $
*
* \$URL: http://chorus-twitter.googlecode.com/svn/trunk/src/twitter/DirectMessage.cs $
*/

using System;
using System.Collections.Generic;
using chorus.utils;

namespace chorus.twitter
{
	/// <summary>
	/// A Twitter direct message.
	/// </summary>
	public class direct_message : Message
	{
		#region XML serialization

		/// <summary>The ID of the sender.</summary>
		public ulong sender_id { get; set; }

		/// <summary>The ID of the recipient.</summary>
		public ulong recipient_id { get; set; }

		/// <summary>The screen name of the sender.</summary>
		public string sender_screen_name;

		/// <summary>The screen name of the recipient.</summary>
		public string recipient_screen_name;

		/// <summary>The sender user object.</summary>
		public user sender { get; set; }

		/// <summary>The recipient user object.</summary>
		public user recipient { get; set; }

		#endregion

		#region Properties

		/// <summary>The status line describing message details.</summary>
		public override string StatLine { get { return base.StatLine + " to @" + recipient.screen_name; } }

		/// <summary>The sending user of the message.</summary>
		public override user From { get { return sender; } }
		/// <summary>The receiving user of the message.</summary>
		public override user To { get { return recipient; } }

		#endregion
	}

	/// <summary>
	/// A response object for a collection of direct messages.
	/// </summary>
	public class direct_messages : IMessageCollectionResponse
	{
		/// <summary>The direct messages in the response.</summary>
		public direct_message[] direct_message;

		/// <summary>The response message collection.</summary>
		public IEnumerable<Message> Messages { get { return direct_message; } }
	}
}
